<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
	#hd{
		width: 500px;
		height: 500px;
		background: purple;
	}
</style>
<script type="text/javascript">
window.onload = function(){
	document.getElementById('hd').onclick = function(e){
		// var ev = window.event || e;
		// var cur = ev.srcElement || ev.target;//获得事件源对象
		// cur.style.background = 'green';
		this.style.background = 'red';

	}
}
</script>
</head>

<body>

<div id="hd"></div>



</body>
</html>
